package me.macd.mindoc.model;

import me.macd.mindoc.util.constants.Constants;

import java.util.Date;

public class Members {
    private Integer memberId;

    private String account;

    private String realName;

    private String password;

    private String authMethod;

    private String description;

    private String email;

    private String phone;

    private String avatar;

    private Integer role;

    private Integer status;

    private Date createTime;

    private Integer createAt;

    private Date lastLoginTime;

    public Members(Integer memberId, String account, String realName, String password, String authMethod, String description, String email, String phone, String avatar, Integer role, Integer status, Date createTime, Integer createAt, Date lastLoginTime) {
        this.memberId = memberId;
        this.account = account;
        this.realName = realName;
        this.password = password;
        this.authMethod = authMethod;
        this.description = description;
        this.email = email;
        this.phone = phone;
        this.avatar = avatar;
        this.role = role;
        this.status = status;
        this.createTime = createTime;
        this.createAt = createAt;
        this.lastLoginTime = lastLoginTime;
    }

    public Members() {
        super();
    }

    public Integer getMemberId() {
        return memberId;
    }

    public void setMemberId(Integer memberId) {
        this.memberId = memberId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getAuthMethod() {
        return authMethod;
    }

    public void setAuthMethod(String authMethod) {
        this.authMethod = authMethod == null ? null : authMethod.trim();
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar == null ? null : avatar.trim();
    }

    public Integer getRole() {
        return role;
    }

    public void setRole(Integer role) {
        this.role = role;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Integer createAt) {
        this.createAt = createAt;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getRoleName() {
        switch (this.role) {
            case Constants.SUPER:
                return "超级管理员";
            case Constants.ADMIN:
                return "管理员";
            case Constants.GENERAL:
                return "普通用户";
            default:
                return "";
        }
    }
}